package com.bsfcs.rag.enums;

import org.springframework.util.StringUtils;

public enum ProcurementMethod {
    LEVEL1_CATALOG("10", "一级目录采购"),
    LEVEL2_CATALOG("20", "二级目录采购"),
    LEVEL3_CONCENTRATED("30", "三级集中采购"),
    SELF_ORGANIZED("40", "自行组织采购"),
    EMERGENCY("50", "紧急采购"),
    DEFAULT("", "");

    private final String code;
    private final String name;

    ProcurementMethod(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    // 可选：根据 code 获取枚举实例
    public static ProcurementMethod fromCode(String code) {
        for (ProcurementMethod method : values()) {
            if (method.code.equals(code)) {
                return method;
            }
        }
        return DEFAULT;
    }
}
